/****************************************************************************
**
** This file is part of qPhotoTag, a photo keywording application
**
** Copyright (C) 2009 Marcell Lengyel <miketkf@gmail.com>
**
** GNU General Public License
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**
****************************************************************************/

/*! \file picturepreviewdialog.cpp
    \brief Contains the implementation of the PicturePreviewDialog class

    The PicturePreviewDialog class is a QDialog subclass and it
    is used for displaying scaled down photos in a separated dialog window.
 */
#include "picturepreviewdialog.h"

PicturePreviewDialog::PicturePreviewDialog(QWidget *parent, const QString &filename)
        : QDialog(parent)
{
    QPixmap orig_pic = QPixmap(filename);
    QLabel *label = new QLabel(this);
    label->setPixmap(orig_pic.scaled(MAX_PICTURE_SIZE,MAX_PICTURE_SIZE,Qt::KeepAspectRatio));
    this->resize(label->pixmap()->size());
    this->setFixedSize(label->pixmap()->size());
    this->setSizeGripEnabled(false);
    this->setModal(false);
}
